
package com.shop.cloud.mall.api.controller;

import com.shop.cloud.common.core.util.R;
import com.shop.cloud.common.portal.util.ThirdSessionHolder;
import com.shop.cloud.mall.api.service.VipUserService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;

/**
 * 会员用户
 *
 * @author
 * @date 2024-04-02 15:22:47
 */
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/vipuser")
@Tag(description = "vipuser", name = "会员用户API")
public class VipUserController {

    private final VipUserService vipUserService;

    /**
     * 查询当前会员用户
     * @return R
     */
    @Operation(summary = "查询当前会员用户")
    @GetMapping("/my")
    public R getMy() {
        return R.ok(vipUserService.getByUserId(ThirdSessionHolder.getUserId()));
    }

}
